class Solution(object):
    def halvesAreAlike(self, s):
        table = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'}
        n = len(s) // 2
        t1 = s[:n]
        t2 = s[n:]

        def count(t):
            return sum([c in table for c in t])

        return count(t1) == count(t2)
